<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  <link href="js/biduEditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
  <link href="js/biduEditor/third-party/mathquill/mathquill.css" type="text/css" rel="stylesheet">
  <link rel="stylesheet" href="css/bootstrap.min.css" />
  <link rel="stylesheet" href="css/diqye.css" />
  <style  tyle="text/css">

	.nav>li>a {
    display: table;
		padding: 4px 20px;
		font-size: 13px;
		font-weight: 500;
		color: #999;
    
	}
  .nav>li>.active{
    border-left: solid 2px black;
  }
  .nav>li{
    margin-left: 20px;
  }
  .bb{
    position: fixed;
    right: 10px;
    bottom: 200px;
    background: white;
  }
  </style>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>19911204</title>
</head>
<body>
  <div class="container" id="container">
  	<h2>h22222222222222222</h2>
  	<h3>h3111111111</h3>
  	<h3>h321111111111111111111</h3>
    <h1>111111111111111111111</h1>
    <h3>111111111111111111</h3>
    <h3>11211111111111111</h3>

    <h1>2111111111111111</h1>
    <h1>311111111111111</h1>
    <h3>3111111111111</h3>
    <h3>3121111111111</h3>
    <h1>4</h1>
    <h3>411</h3>
    <h1>5</h1>
  </div>
  <footer class="container">
    <p class="text-center"><small>备份成员信息，供不时之需</small></p>  
  </footer>	
  <script type="text/javascript"  src="js/lib/require.js"></script>
  <script type="text/javascript" src="js/main.js"></script>
  <script>
    require(["jtmpl","jext",'bootstrap'],function(a,$){
      	function nav_right(div){
      		var navs=[],l,h,item,id=100;
      		div.find("h1,h2,h3").each(function(){
      			var _=$(this);
            _.attr("nav",true);
      			if(_.is("h1")){
      				navs.push({name:_.text(),h:1,point:id});
      				_.attr("id",id++);
      			}

      			if(_.is("h2")){
      				l=navs.length-1;
      				item={name:_.text(),h:2,point:id};
      				_.attr("id",id++);
      				if(l==-1){
      					navs.push(item);
      				}else{
      					h=navs[l];
      					if(h.h==1){
      						if(h.child)h.child.push(item);
      						else h.child=[item];
      					}else{
      						navs.push(item);
      					}
      				}
      			}

      			if(_.is("h3")){
      				l=navs.length-1;
      				item={name:_.text(),h:3,point:id};
      				_.attr("id",id++);
      				if(l==-1){
      					navs.push(item);
      					return;
      				}

      				h=navs[l];
      				if(h.h==1){
      					if(h.child){
      						if(h.child.h==2){
      							if(h.child.child)h.child.child.push(item);
      							else h.child.child=[item];
      							return;
      						}
      						h.child.push(item);
      						return;
      					}
      					h.child=[item];
      					return;
      				}

      				if(h.h==2){
      					if(h.child)h.child.push(item);
      					else h.child=[item];
      					return;
      				}
      				navs.push(item);
      			}
      		});
			
    			$(document.body).append("ejs/common/nav_right.ejs",{data:navs},function(){
            var h = $("[nav]"),a,b;
    				$(window).on("scroll",function(e){
              h.each(function(){
                b=$(this).offset().top;
                if(document.body.scrollTop>=b){
                  a=$(this);
                }
              });
              if(a==null)return;
              $(".nav>li>a").removeClass("active");
              $(".nav>li>a[href=#"+a.attr("id")+"]").addClass("active");
            });
    			});
      	}
      	nav_right($("#container"))
    });
  </script>
</body>
</html>